Mongo环境搭建配置-客户端
下载安装
https://www.mongodb.com/download-center/community?jmp=nav
客户端连接
新mongo环境 mongo mongodb://127.0.0.1:27017
然后创建账号并授权.
mongo mongodb://nlp:nlp@192.168.1.42:27017
参考:https://www.mongodb.org.cn/tutorial/7.html
1 | show dbs |
Docker整合Prometheus、Grafana监控MongoDB
Docker整合Prometheus、Grafana监控MongoDB
1 | # 启动 mongodb_exporter 监控mongo |
- 另一种方式。 先进行镜像编译. {镜像太大太复杂。不建议了}
1 | git clone git@github.com:dcu/mongodb_exporter.git |
问题
- eses/mongodb_exporter 没有找到现成的grafana面板.
- elarasu/mongodb_exporter 基于 dcu/mongodb_exporter.
https://github.com/percona/mongodb_exporter - 其他镜像都和 监控面板不匹配。 chux0519/mongodb_exporter 和 https://grafana.com/grafana/dashboards/2583 匹配。
另外一些其他监控指标可以后续了解支持.
- Prometheus 添加配置
1 | # 进入 Prometheus 的容器. 修改配置 |
- 获取grafana json配置
https://grafana.com/grafana/dashboards?search=mongo&orderBy=name&direction=asc
找到适合的仪表盘.
mongodb_replset_member_state
请大家为西银高铁、西部交通辛勤付出的同志们投一票,非常感谢, 请选择马校伟,李全,何俊.